1. Field of the Invention
The present invention generally relates to a printing method for printing an image and a plurality of characters by means of a printer, a copier, a fax and so on, and more particularly to a gray scale image processing apparatus and a gray scale image processing method therefor, in which a texture in an output image is eliminated.
2. Description of the Related Art
In the field of the printer, the copier, the fax and so on, images which are usually processed are not only binary images but also gray scale images. However, the copier, the fax and so on usually output an image which has a smaller number of gray scale levels than that of an input image. For example, the input image having 256 levels is often printed as a binary image. Therefore, for example, a dither method or a tone production method by density pattern is often used to represent the gray scale image.
In the dither method, one printing pixel is assigned to correspond to one pixel of the input image. On the other hand, in the tone production method by density pattern, many printing pixels are assigned to correspond to one pixel of the input image so that the input image size is substantially enlarged. Therefore, the output image size is larger than the input image size. This is a disadvantage for the gray scale processing apparatus.
FIG. 1 shows a gray scale image processing for a binary image printer according to the prior art in which the dither method is used.
First, an image size 102 of the input image 101 is detected. For example, let the coordinates of an upper left point be (0,0), the coordinates of an upper right point be (999,0), the coordinates of a lower left point be (0,999) and the coordinates of a lower right point be (0,0) when a horizontal size of the input image is 1000 pixels and a vertical size of the input image is 1000 pixels. Next, a pixel number is designated by a counter 103. Next, coordinates 104 (x,y) of the designated pixel by the counter 103 is determined, such that, for example, coordinates (0,0) are designated when the output number of the counter 103 is 0, coordinates (999,0) are designated when the output number of the counter 103 is 999 and coordinates (0,1) are designated when the output number of the counter 103 is 1000. Next, a selector 105 selects one pixel from the input image 101. This pixel is referred to as a regarded pixel. Next, a value 106 f(x,y) of the regarded pixel of the input image 101 is determined. Then, a selector 108 compares the value 106 f(x,y) of the regarded pixel with a corresponding threshold level in a dither matrix 107. If the corresponding threshold level is larger than the value 106 f(x,y), the selector 108 outputs zero. Otherwise, the selector outputs one. An output value 109 Fz(x,y) is a gray scale value of the pixel at a corresponding position of the coordinates 104 (x,y) in an output image 110. Next, if the coordinates 104 (x,y) of the output pixel 109 Fz(x,y) is within an input image size 102, the counter 103 is incremented by an instruction 111 to process a next pixel. Then, a next regarded pixel is processed as mentioned above until all the pixels of the input image is processed.
However, the gray scale processing method as mentioned above has a following problem.
FIGS. 2A, 2B and 2C show examples of arrangements of dots of the output image according to the prior art, which causes the problem. In the prior art, if the pixel value f(x,y) at the coordinates (x,y) of the input image is less than a threshold B, the dot of the output image is placed as shown in FIG. 2A irrespective of the pixel value f(x,y). If the pixel value f(x,y) at the coordinates (x,y) of the input image is equal to the threshold B, the dots of the output image are placed as shown in FIG. 2B. If the pixel value f(x,y) at the coordinates (x,y) of the input image is larger than the threshold B, the dots of the output image are placed as shown in FIG. 2C irrespective of the pixel value f(x,y). Therefore, if the regarded pixel value is less than the threshold value in the dither matrix, the dot of the output image is placed in the same arrangement irrespective of the pixel value and if the regarded pixel value is larger than the threshold value in the dither matrix, the dots of the output image are also placed in the same arrangement irrespective of the pixel value. This means that the arrangement of the dots can not be changed based on the pixel value. As a result, a texture corresponding to the dither matrix in the output image will appear because the arrangement of the dots is fixed according to the threshold in the dither matrix.
It is a general object of the present invention to provide a gray scale image processing apparatus and a gray scale image processing method therefor, in which the above disadvantages are eliminated.
A more specific object of the present invention is to provide a gray scale image processing apparatus and a gray scale image processing method therefor, in which a texture in an output image is eliminated.
The above objects of the present invention are achieved by a gray scale image processing method which converts an input image, each pixel of which has a value between 0 and N, to an output image, each pixel of which is represented by a gray scale value of A levels. The method has a generation step of generating B reference images, in each of which each pixel is represented by a gray scale value of the A levels, from B elementary images, in each of which all pixels have the same value between 0 and N, using one or more different error distribution matrixes according to said A levels,
a selection step of selecting one of the B reference images based on a pixel value f(x,y) of the input image at coordinates (x,y) and
an output step of outputting a pixel value represented by a gray scale value of the A levels of the selected one of the B reference images at a position corresponding to the coordinates (x,y).
According to the invention, it is possible to change the arrangement of the dots according to the pixel value of the input image because the reference image can be generated without any restriction and gray scale values of the reference image can be output according to the pixel value of the input image.